﻿using CommunityToolkit.Mvvm.ComponentModel;
using GameView.Comment;

namespace GameView.Services.Dtos.RechargesDto
{
    public partial class RechargeRecord : ObservableObject
    {
        /// <summary>
        /// 充值前余额
        /// </summary>
        [ObservableProperty]
        public int _beforeBalance = 0;
        /// <summary>
        /// 充值后余额
        /// </summary>
        [ObservableProperty]
        public int _afterBalance = 0;

        [ObservableProperty]
        private bool _isSelected;

        [ObservableProperty]
        private int _id;

        [ObservableProperty]
        private string _orderNumber = string.Empty;

        [ObservableProperty]
        private string _projectName = string.Empty;

        [ObservableProperty]
        private string _gameName = string.Empty;

        [ObservableProperty]
        private string _characterName = string.Empty;

        [ObservableProperty]
        private int _changeType = 4001;
        public string ChangeTypeDisplay => ChangeType.GetDisplay();

        /// <summary>
        /// 实际金额
        /// </summary>
        [ObservableProperty]
        public uint _realAmount = 0;

        [ObservableProperty]
        private uint _rechargeAmount;

        [ObservableProperty]
        private string _merchant = string.Empty;

        [ObservableProperty]
        private uint _merchantBalance;

        [ObservableProperty]
        private string _createdTime = string.Empty;

        [ObservableProperty]
        private int _rechargeOrderStatus = 3004;
        public string RechargeOrderStatusDisplay => RechargeOrderStatus.GetDisplay();

        [ObservableProperty]
        private string _remark = string.Empty;
        // 添加设置时间的方法
        public void SetCreatedTime(DateTime dateTime)
        {
            CreatedTime = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
        }
    }
}